package com.atguigu.tingshu.user.config;

import com.atguigu.tingshu.common.constant.KafkaConstant;
import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.config.TopicBuilder;

/**
 * @author: atguigu
 * @create: 2024-05-09 15:17
 */
@Configuration
public class KafkaTopicConfig {

    /**
     * 新建用户注册话题
     * @return
     */
    @Bean
    public NewTopic loginRegister() {
        return TopicBuilder
                .name(KafkaConstant.QUEUE_USER_REGISTER)
                .partitions(3)
                .replicas(1)
                .build();
    }
}
